<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:p="http://primefaces.org/ui">
 
 <f:loadBundle basename="resources.application" var="msg"/>
<ui:composition template="/index.xhtml">

  <ui:define name="menu">
    <h:commandLink value="Inicio"  action="index.html"/>
  </ui:define>

<ui:define name="conteudo">

<h1>Cadastro de Vinho</h1>
<h:form id="form">  
  
    <p:panel id="panel" header="New Person">  
  
        <p:messages id="msgs"/>  
  
        <h:panelGrid columns="3">  
            <h:outputLabel for="nome" value="Nome: *" />  
            <p:inputText id="nome" value="#{vinhoBean.nome}" required="true" label="nome">  
                <f:validateLength minimum="2" />  
            </p:inputText>
            <p:message for="nome" display="icon"/>  
  
            <h:outputLabel for="produtor" value="Produtor: *" />  
            <p:inputText id="produtor" value="#{produtorVinho.produtor}" label="produtor" required="true">  
                <f:validateLength minimum="2" />  
                <p:ajax update="msgSurname" event="keyup" />  
            </p:inputText>  
            <p:message for="produtor" id="msgSurname" display="icon"/>

             <h:outputLabel value="Max Results(5) :" for="acMaxResults" />
              <p:autoComplete id="acMaxResults" maxResults="5"   
                     value="#{vinhoBean.pais}"
                     completeMethod="#{paisesBean.listaPaises}"/>  
                  
            <h:outputLabel value="DropDown :" for="dd" />
            <p:autoComplete id="dd" dropdown="true" value="#{tipoVinhoBean.tipoVinho}"   
                    completeMethod="#{tipoVinhoBean.listaTipoVinho}" />  
             
              
  
        </h:panelGrid>  
  
    </p:panel>  
        <p:commandButton id="btn" value="Save" update="panel" actionListener="#{testaInclusao.incluir}"/>  
        
     <p:dialog header="Values" widgetVar="dialog"  
            showEffect="fold" hideEffect="fold" width="200">  
              
         <h:panelGrid id="display" columns="2" cellpadding="5"> 
          
            <h:outputText value="Value 6: " />  
            <h:outputText value="#{vinhoBean.pais}" />   
  
            <h:outputText value="Value 7: " />  
            <h:outputText value="#{tipoVinhoBean.tipoVinho}" />  
        </h:panelGrid>  
          
    </p:dialog>  
  
 </h:form>
 </ui:define>
 </ui:composition>  
</html>
